<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../../css/index.css" />
    <style>

       	.backcard-list{width: 100%;}
		.backcard-list .backcard-one{width: 100%;background: #ffffff;padding: 0 15px;box-sizing: border-box;margin-bottom: 10px;}
		.backcard-list .backcard-one .top-box{font-size: 15px;color: #333333;box-sizing: border-box;padding: 12px 0 15px 0;}
        .backcard-list .backcard-one .top-box .img-box{width: 30px;}
        .backcard-list .backcard-one .top-box .img-box img{width: 30px;height: 30px;}
        .backcard-list .backcard-one .top-box .cont{padding-left: 10px;box-sizing: border-box;}
		.backcard-list .backcard-one .top-box .t1{font-weight: 700;font-size: 16px;}
		.backcard-list .backcard-one .top-box .t2{font-size: 14px;color: #999999;padding-top: 4px;}

    	.backcard-list .backcard-one .bot-box{height: 40px;align-items: center;font-size: 12px;}
    	.backcard-list .backcard-one .bot-box .moren-btn{padding-left: 26px;box-sizing: border-box;background: url(../../../image/main2/sel_icon0.png) no-repeat left center;background-size:18px;}
    	.backcard-list .backcard-one .bot-box .del{height: 54px;margin-left: 15px;padding-left: 20px;box-sizing: border-box;background: url(../../../image/main3/addr_icon2.png) no-repeat left center;
        background-size:14px;line-height: 54px;}
    	.backcard-list .backcard-one .bot-box .edit{height: 54px;margin-right:15px;padding-left: 20px;box-sizing: border-box;background: url(../../../image/main3/addr_icon1.png) no-repeat left center;background-size:14px;line-height: 54px;}
        .backcard-list .backcard-one .bot-box .fg{height: 14px;width:1px;}
    	.backcard-list .backcard-one.on .bot-box .moren-btn{background: url(../../../image/main2/sel_icon1.png) no-repeat left center;background-size:18px;}
    	.backcard-list .backcard-one.on .top-box .moren{padding-left: 8px;font-size: 12px;color: #FF9502;display: block;}
        
    </style>
</head>

<body>
    <div id="vue">

    	<div class="backcard-list" style="display:none;" :style="{ display:(Pdata ? '':'none')}">
    		<div class="backcard-one" v-for="(item,key) in Pdata.listData" :data-id="item.id">
    			<div class="top-box flex">
                    <div class="img-box">
                        <img src="../../../image/main3/store/bankcard.png" alt="">
                    </div>
                    <div class="cont flex1">
                        <div class="t1" v-text="item.bankName"></div>
        				<div class="t2">开户行：<i v-text="item.bankAddress"></i></div>
                        <div class="t2">银行卡号：<i v-text="item.cardNumber"></i></div>
                    </div>
    			</div>
    			<div class="bot-box flex border-top">
                    <div class="flex1"></div>
    				<div class="del flex" tapmode onclick="delClick(this);" :data-id="item.id">删除</div>
    			</div>
    		</div>
    	</div>

        <!--占位图-->
        <div class="nodata" style="display:none;" :style="{ display:(noData ? '':'none')}">
            <img src="../../../image/no_page/no_dizhi.png" />
            <p>暂无银行卡</p>
        </div>
        <!-- 底部 -->
        <div class="bottom-box" :style="{ display:(loadingMsg ? '':'none')}">
            <div class="msgbox" v-html="loadingMsg" style="color:#999;"></div>
        </div>

    	<!--底部的立即分享按钮-->
        <div style="width:100%;height:100px;"></div>
		<div class="warp-btn" id="app-footer" tapdome onclick="addbackcard()">
            <div class="btn" style="font-size: 15px;">新增</div>
        </div>

    </div>

<script type="text/javascript" src="../../../script/base.min.js" id="loadjs" data-load=""></script>
<script type="text/javascript">

	define(function (require, exports, module) {
        lanYun.setFooter('app-footer');
        var stype = pageParam.type;
        var url = {
            "company":{
                "list":'company/BankCard/index',
                "del":'company/BankCard/del',
            },
            "store":{
                "list":'store/BankCard/index',
                "del":'store/BankCard/del',
            },
        }

	    getData = function(loading) {
	        lanYun.getVueData({url:url[stype].list,get:{page:lanYun.page},cache:0,loading:loading}, function(ret){
                //console.log(JSON.stringify(ret));
	        });
	    };
	    lanYun.newVue('#vue', function() {
	        getData(2);
	    });

	    //滚动加载..
		new auiScroll({distance:200, listen:true},function(ret) {
			if($(window).scrollTop() < 2) ret.isToBottom = false;
			if(!ret.isToBottom) return;
			getData(0);
		});

	    //============================
        onShow = function () {
			var reshpage = lanYun.getStorage('reshpage');
			if(reshpage){
				lanYun.rmStorage('reshpage');
                lanYun.ajaxPageSta = 0; lanYun.page = 1;
				getData(2);
			}
		}

        //删除地址
        delClick = function (tis){
			var dst = tis.dataset;
			lanYun.alert({fname:'diaLogBox1',title:'提示', button:['取消','确定'],content: '您确定要删除银行卡吗？'},function(ret){
	            if (ret.index == 0) return;
                lanYun.get(url[stype].del + '?id='+ dst.id,function (ret) {
                    lanYun.toast(ret.msg);
                    if(ret.errcode == 0){
                        lanYun.page = 1;lanYun.ajaxPageSta = 0;
        	            getData(2);
                    }
                })
	        });
		}

	    //添加银行卡
	    addbackcard = function(tis){
	        lanYun.openWin('main3/bank/bankcard_add.html', {
	            title : '添加银行卡',
	            frameParam : {type:stype},
	        });
	    };

	});
</script>
</body>
</html>
